﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MainLayout.master" AutoEventWireup="false"
    CodeFile="strans.aspx.vb" Inherits="strans" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript" src="scripts/overlib.js"></script>
    <h1>
        Property Transact(Sales)</h1>
    <hr />
    <asp:Label ID="lblStaffUID" runat="server" Visible="false" />
    <asp:Label ID="lblTransUID" runat="server" Visible="false" />
    <asp:Label ID="lblStaffType" runat="server" Visible="false" />
   <div  runat="server" id="divError" class="msg-box-error" visible="false" enableviewstate="false">
    
        <span class="title">Error</span><br />
        <asp:Label ID="lblMsgError" runat="server" Text="ERROR" />
        </div>
<div  runat="server" id="divSuccessful" class="msg-box-success" visible="false" enableviewstate="false">
    
        <span class="title">Successful</span><br />
        <asp:Label ID="lblMsgSuccessful" runat="server" Text="Success" />
    
</div>
    <p><%--Description of the page--%></p>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="udpContentGeneral">
        <ProgressTemplate>
            <div style="top: 0px; position: fixed; width: 100%; text-align: center">
                <span style="background-color: Yellow; font-weight: bold">Loading ...</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                     <table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>General Information</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top" >
                    <div>
                        <asp:UpdatePanel ID="udpContentGeneral" runat="server" EnableViewState="True">
                            <ContentTemplate>
                                <table class="General-info-table " id="divContentGeneral" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <th scope="row" style="width: 250px" >
                                            Transact As :
                                        </th>
                                        <td style="display:inline;">
                                            <asp:RadioButtonList ID="rbtTransactAs" runat="server" RepeatDirection="Horizontal"
                                                AutoPostBack="true" style="margin-left:0px; padding-left:0px; display:inline; text-align:left;">
                                                <%-- <asp:ListItem Text="SR" Value="1" />
                                    <asp:ListItem Text="SC" Value="2" />
                                    <asp:ListItem Text="SL" Value="3" />
                                    <asp:ListItem Text="SI" Value="4" />--%>
                                            </asp:RadioButtonList>
                                            <span style="color: Red">*</span>
                                            <asp:RequiredFieldValidator ID="rfvrbtTransactAs" ControlToValidate="rbtTransactAs"
                                                SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="Required"
                                                ForeColor="Red" Display="Dynamic" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Open File Number :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtOpenFileNumber" runat="server" Font-Size="12px"/>
                                        </td>
                                    </tr>
                                    <%-- Remove @ 6/5/2011 as this will only update after the money collected --%>
                                    <%-- <tr>
                                        <th scope="row">
                                            Invoice Number :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtInvoiceNumber" runat="server" />
                                        </td>
                                    </tr>--%>
                                    <tr>
                                        <th scope="row">
                                            List By :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtLister" runat="server" Font-Size="12px" /><asp:Label ID="lblhidListerID" runat="server"
                                                Visible="false" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Transact By :
                                        </th>
                                        <td>
                                            <asp:Label ID="lblTransactor" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>                                      
                                    <tr id="trProjectName" runat="server">
                                        <th scope="row">
                                            Project Name :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtProjectName" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Premise Name :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtPremiseName" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            List Date :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtListDate" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Transact Date :
                                        </th>
                                        <td>
                                            <asp:Label ID="lblTransactDate" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    
                </td>
            </tr>
        </table>
    </div>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                     <table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>Sales Informaotin</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top" >
                    <div>
                        <table class="General-info-table " id="Table1" cellpadding="0" cellspacing="0">
                            <tr>
                                <th scope="row" style="width: 250px" >
                                    Transacted Price :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtTransactPrice" runat="server" />&nbsp;&nbsp;Deposit Paid RM
                                    <asp:TextBox ID="txtDepositPaid" runat="server" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtTransactPrice" ControlToValidate="txtTransactPrice"
                                        SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                    <asp:RequiredFieldValidator ID="rfvtxtDepositPaid" ControlToValidate="txtDepositPaid"
                                        SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr id="TRProject" runat="server">
                                <th scope="row">
                                    Mode of Payment :
                                </th>
                                <td>
                                    <asp:DropDownList ID="ddlModeOfPayment" runat="server">
                                        <asp:ListItem Text="-SELECT-" Value="0" Selected="True" />
                                        <asp:ListItem Value="1" Text="Cheque directly issued to vendor" />
                                        <asp:ListItem Value="2" Text="Paid to bank account of vendor" />
                                        <asp:ListItem Value="3" Text="Cash to vendor" />
                                        <asp:ListItem Value="4" Text="Paid to company" />
                                    </asp:DropDownList>
                                    &nbsp; ON&nbsp;<asp:TextBox ID="txtPayOn" runat="server" onKeyPress="javascript: return false;"
                                        onPaste="javascript: return false;" />
                                    <asp:ImageButton runat="Server" ID="imgPayDateCal" ImageUrl="~/images/style01/Btn-calendar.png" AlternateText="Click to show calendar" style="vertical-align:middle;" />
                                    <cc1:CalendarExtender ID="cePayDate" runat="server" Format="dd-MMM-yyyy" TargetControlID="txtPayOn"
                                        PopupButtonID="imgPayDateCal" EnableViewState="false" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvddlModeOfPayment" ControlToValidate="ddlModeOfPayment"
                                        SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic"  />
                                    <asp:RequiredFieldValidator ID="rfvtxtPayOn" ControlToValidate="txtPayOn" SetFocusOnError="true"
                                        runat="server" ValidationGroup="strans" ErrorMessage="<br />Required" ForeColor="Red"
                                        Display="Dynamic" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Requisition :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtRequisition" runat="server" TextMode="MultiLine" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtRequisition" ControlToValidate="txtRequisition"
                                        SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr id="CoBroke" runat="server">
                                <th scope="row">
                                    Co-Broke :
                                </th>
                                <td>
                                    <asp:Label ID="lblCoBroke" runat="server" onmouseout="return nd();" style="cursor: pointer;" font-size="12px" />
                                    <%--co-broke details--%>
                                    <asp:Label ID="lblhidCoBrokeId" runat="server" Visible="false" font-size="12px" />
                                    <asp:Label ID="lblhidCoBrokeAgencyName" runat="server" Visible="false" font-size="12px" />
                                    <asp:Label ID="lblhidCoBrokePhone" runat="server" Visible="false" font-size="12px" />
                                    <asp:Label ID="lblhidCoBrokeMobile" runat="server" Visible="false" font-size="12px" />
                                    <asp:Label ID="lblhidCoBrokeFax" runat="server" Visible="false" font-size="12px" />
                                    <asp:Label ID="lblhidCoBrokeEmail" runat="server" Visible="false" font-size="12px" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    
                </td>
            </tr>
        </table>
    </div>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="0" width="100%">
            <%--<tr><td colspan="2"><div class="General-info-title"><h3>Particular</h3></div></td></tr>--%>
            <tr valign="top">
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td colspan="2" style="padding:0px;">
                                
                                <table width="100%"><tr><td class="General-info-title" style="width:250px; padding-left:5px;"><h3>
                                    Vendor Information<asp:CheckBox ID="chkVendorCompany" runat="server" Text="Company"
                                            Font-Bold="false" Font-Size="Small" ForeColor="Gray" onClick="checkVendorCompanyInfo()" /></h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr id="VName1" runat="server" style="display:block;">
                            <th scope="row" >
                                (1) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorName1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorName1" ControlToValidate="txtVendorName1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="VName2" runat="server" style="display:block;">
                            <th scope="row">
                                (2) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorName2" runat="server" onkeyup="Validation('VName2')" />
                            </td>
                        </tr>
                        <tr id="VName3" runat="server" style="display:block;">
                            <th scope="row">
                                (3) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorName3" runat="server" onkeyup="Validation('VName3')" />
                            </td>
                        </tr>
                        <tr id="VComName" runat="server" style="display:table-row;" >
                            <th scope="row">
                                Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorCompanyName" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorCompanyName" ControlToValidate="txtVendorCompanyName"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="VIC1" runat="server" style="display:block;">
                            <th scope="row">
                                (1) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorNric1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorNric1" ControlToValidate="txtVendorNric1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="VIC2" runat="server" style="display:block;">
                            <th scope="row">
                                (2) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorNric2" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorNric2" ControlToValidate="txtVendorNric2"
                                    runat="server" ValidationGroup="strans" ErrorMessage="<br />Required" ForeColor="Red"
                                    Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="VIC3" runat="server" style="display:block;">
                            <th scope="row">
                                (3) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorNric3" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorNric3" ControlToValidate="txtVendorNric3"
                                    runat="server" ValidationGroup="strans" ErrorMessage="<br />Required" ForeColor="Red"
                                    Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="VCompanyNo" runat="server" style="display:table-row;">
                            <th scope="row">
                                Company No :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorCompanyNo" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorCompanyNo" ControlToValidate="txtVendorCompanyNo"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorContactPerson" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorContactPerson" ControlToValidate="txtVendorContactPerson"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorAddress" runat="server" TextMode="MultiLine" Height="100px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorFax" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Mobile :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorMobile" runat="server" onkeypress="return isNumberKeyOnly(event)"
                                    onpaste="return false;" MaxLength="11" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorMobile" ControlToValidate="txtVendorMobile"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th rowspan="row">
                                Referral :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlVendorRefer" runat="server" onChange="checkVendorRefer()">
                                    <asp:ListItem Text="No" Value="0" />
                                    <asp:ListItem Text="Yes" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="VRefName" runat="server">
                            <th scope="row" style="display:table-row;">
                                Referral Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorReferName" runat="server" TextMode="MultiLine" Height="100px" />
                            </td>
                        </tr>
                        <tr id="VRefNRIC" runat="server" style="display:table-row;">
                            <th scope="row">
                                Referral NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorReferNRIC" runat="server" />
                            </td>
                        </tr>
                        <tr id="VRefContact" runat="server" style="display:table-row;">
                            <th scope="row">
                                Referral Contact :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorReferContact" runat="server" />
                            </td>
                        </tr>
                        <tr id="VRefStatus" runat="server" style="display:table-row;">
                            <th scope="row" style="display:table-row;">
                                Referral Status :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlVendorReferStatus" runat="server" onChange="Calculation()">
                                    <asp:ListItem Text="From Vendor" Value="0" />
                                    <asp:ListItem Text="From Purchaser" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="VRefAmount" runat="server" style="display:table-row;">
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtVendorReferAmt" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorReferAmt" ControlToValidate="txtVendorReferAmt"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorCompName" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorContactPerson" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" valign="top">
                                Solicitors Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorsAddress" runat="server" TextMode="MultiLine"
                                    Height="100px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorsPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtVendorSolicitorsFax" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td colspan="2" style="padding:0px;">
                                <table width="100%"><tr><td class="General-info-title" style="width:250px;padding-left:5px;"><h3>
                                    Purchaser Information<asp:CheckBox ID="chkPurcCompany" runat="server" Text="Company"
                                            Font-Bold="false" Font-Size="Small" ForeColor="Gray" onClick="checkPurcCompanyInfo()" /></h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr id="PName1" runat="server">
                            <th scope="row">
                                (1) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcName1" runat="Server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcName1" ControlToValidate="txtPurcName1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="PName2" runat="server">
                            <th scope="row">
                                (2) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcName2" runat="server" onkeyup="Validation('PName2')" />
                            </td>
                        </tr>
                        <tr id="PName3" runat="server">
                            <th scope="row">
                                (3) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcName3" runat="server" onkeyup="Validation('PName3')" />
                            </td>
                        </tr>
                        <tr id="PComName" runat="server" style="display:table-row;">
                            <th scope="row">
                                Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcCompanyName" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcCompanyName" ControlToValidate="txtPurcCompanyName"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="PIC1" runat="server">
                            <th scope="row">
                                (1) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcNric1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcNric1" ControlToValidate="txtPurcNric1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr id="PIC2" runat="server">
                            <th scope="row">
                                (2) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcNric2" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcNric2" ControlToValidate="txtPurcNric2"
                                    runat="server" ValidationGroup="strans" ErrorMessage="<br />Required" ForeColor="Red"
                                    Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="PIC3" runat="server">
                            <th scope="row">
                                (3) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcNric3" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcNric3" ControlToValidate="txtPurcNric3"
                                    runat="server" ValidationGroup="strans" ErrorMessage="<br />Required" ForeColor="Red"
                                    Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="PCompanyNo" runat="server" style="display:table-row;">
                            <th scope="row">
                                Company No :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcCompanyNo" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcCompanyNo" ControlToValidate="txtPurcCompanyNo"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcContactPerson" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcContactPerson" ControlToValidate="txtPurcContactPerson"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcAddress" runat="server" TextMode="MultiLine" Height="100px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcFax" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Mobile :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcMobile" runat="server" onkeypress="return isNumberKeyOnly(event)"
                                    onpaste="return false;" MaxLength="11" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcMobile" ControlToValidate="txtPurcMobile"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th rowspan="row">
                                Referral :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlPurcRefer" runat="server" onChange="checkPurcRefer()">
                                    <asp:ListItem Text="No" Value="0" />
                                    <asp:ListItem Text="Yes" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="PRefName" runat="server">
                            <th scope="row">
                                Referral Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcReferName" runat="server" TextMode="MultiLine" Height="100px" />
                            </td>
                        </tr>
                        <tr id="PRefNRIC" runat="server">
                            <th scope="row">
                                Referral NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcReferNRIC" runat="server" />
                            </td>
                        </tr>
                        <tr id="PRefContact" runat="server">
                            <th scope="row">
                                Referral Contact :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcReferContact" runat="server" />
                            </td>
                        </tr>
                        <tr id="PRefStatus" runat="server">
                            <th scope="row">
                                Referral Status :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlPurcReferStatus" runat="server" onChange="Calculation()">
                                    <asp:ListItem Text="From Purchaser" Value="0" />
                                    <asp:ListItem Text="From Vendor" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="PRefAmount" runat="server">
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtPurcReferAmt" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcReferAmt" ControlToValidate="txtPurcReferAmt"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorCompName" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorContactPerson" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" valign="top">
                                Solicitors Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorsAddress" runat="server" TextMode="MultiLine" Height="100px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorsPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Solicitors Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtPurcSolicitorsFax" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    
                </td>
            </tr>
        </table>
    </div>
    <asp:UpdatePanel ID="updStampDuty" runat="server">
    <ContentTemplate>  
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr valign="top">
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding-left:0px;">
                                <table width="100%"><tr><td class="General-info-title" style="width:100px;"><h3>Vendor Fees</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width:135px;">
                                Agency Fee :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtVendorAgencyFee" runat="server" onkeyup="Calculation()" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" Text="0.00" Width="80px" />
                                &nbsp;+&nbsp;
                                <asp:TextBox ID="txtVendorGsts" runat="Server" onkeyup="Calculation()" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" Text="0.00"  Width="80px"/>&nbsp;% GST&nbsp;<asp:CheckBox ID="chkVendorGstPaid"
                                        runat="Server" Text="Paid By Vendor" onClick="Calculation()"  />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtVendorAgencyFee" ControlToValidate="txtVendorAgencyFee"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                                <asp:RequiredFieldValidator ID="rfvtxtVendorGsts" ControlToValidate="txtVendorGsts"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 135px">
                                Referral Amount :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="lblVendorReferralAmt" runat="server" BackColor="Transparent" 
                                    onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 135px">
                                Listing Fee :
                            </th>
                            <td>
                                <asp:Label ID="lblListingPercent" runat="server" Text="0.00" />%
                                <asp:Button ID="btnGetListingFee" runat="server" Text="Get Listing Fee"  CssClass="search-btn" Width="100px"/>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding-left:5px;">
                                <table width="100%"><tr><td class="General-info-title" style="width:120px;"><h3>Purchaser Fees</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Disbursement Fee :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtPurcDisbursement" runat="server" onkeyup="Calculation()" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" Text="0.00" Width="100px" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtPurcDisbursement" ControlToValidate="txtPurcDisbursement"
                                    SetFocusOnError="true" runat="server" ValidationGroup="strans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM<asp:TextBox ID="lblPurcReferralAmt" runat="server" BackColor="Transparent" 
                                    onKeyPress="javascript: return false;" onPaste="javascript: return false;" Width="100px" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                    <table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>Fees Summary</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top" >
                    <div>
                        <table class="General-info-table " id="Table2" cellpadding="0" cellspacing="0">
                            <tr>
                                <th scope="row" style="width: 250px" >
                                    Total Agency Fee :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblTotalAgencyFee" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    For Lister :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblForLister" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    For Referral :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblReferral" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    For Gorvement :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblForGorv" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Gross Amount :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblGrossAmount" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    
                </td>
            </tr>
        </table>
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="upgContentGeneral" runat="server" AssociatedUpdatePanelID="udpContentGeneral">
        <ProgressTemplate>
            <div style="top: 0px; position: fixed; width: 100%; text-align: center">
                <span style="background-color: Yellow; font-weight: bold">Loading ...</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div class="Confirmation-Container">
               <table width="100%" style="margin-left:0px;">
                        <tr>
                            <td ><div class="General-info-title-line"></div></td>
                            <td style="width:170px;"> 
                                &nbsp;<asp:Button ID="btnBack" runat="server" Text="Back" CssClass="search-btn" Width="60" />
                                &nbsp;<asp:Button ID="BtnSave" runat="server" Text="Save" ValidationGroup="strans" CssClass="search-btn" Width="80" />
                                &nbsp;
                                <cc1:ConfirmButtonExtender ID="CBEBack" runat="server" TargetControlID="btnBack" />
                            </td>
                            <td style="width: 60px"><div class="General-info-title-line"></div></td>
                        </tr>
                    </table>
    </div>
    <%--hidden field--%>
    <asp:Label ID="lblhidPropertyId" runat="server" Visible="false" />
    <asp:Label ID="lblhidTransactorId" runat="server" Visible="false" />

    <script language="javascript" type="text/javascript">
 function checkVendorRefer() {
    var ddlVendorRefer = document.getElementById('<%=ddlVendorRefer.ClientID %>');
    var VRefName = document.getElementById('<%=vRefName.ClientID %>');
    var VRefNRIC = document.getElementById('<%=vRefNRIC.ClientID %>');
    var VRefContact = document.getElementById('<%=vRefContact.ClientID %>');
    var VRefStatus = document.getElementById('<%=vRefStatus.ClientID %>');
    var VRefAmount = document.getElementById('<%=vRefAmount.ClientID %>');

    if (ddlVendorRefer.options[ddlVendorRefer.selectedIndex].value=='1') {
        VRefName.style.display = "table-row";
        VRefName.style.visibility = "visible";
        VRefNRIC.style.display = "table-row";
        VRefNRIC.style.visibility = "visible";
        VRefContact.style.display = "inline";
        VRefContact.style.visibility = "visible";
        VRefStatus.style.display = "table-row";
        VRefStatus.style.visibility = "visible";
        VRefAmount.style.display = "table-row";
        VRefAmount.style.visibility = "visible";
    }
    else {
        VRefName.style.display = "none";
        VRefName.style.visibility = "hidden";
        VRefNRIC.style.display = "none";
        VRefNRIC.style.visibility = "hidden";
        VRefContact.style.display = "none";
        VRefContact.style.visibility = "hidden";
        VRefStatus.style.display = "none";
        VRefStatus.style.visibility = "hidden";
        VRefAmount.style.display = "none";
        VRefAmount.style.visibility = "hidden";        
    }
    }
    
    function checkPurcRefer(){
    var ddlPurcRefer = document.getElementById('<%=ddlPurcRefer.ClientID %>');
    var PRefName = document.getElementById('<%=PRefName.ClientID %>');
    var PRefNRIC = document.getElementById('<%=PRefNRIC.ClientID %>');
    var PRefContact = document.getElementById('<%=PRefContact.ClientID %>');
    var PRefStatus = document.getElementById('<%=PRefStatus.ClientID %>');
    var PRefAmount = document.getElementById('<%=PRefAmount.ClientID %>');
    
    if (ddlPurcRefer.options[ddlPurcRefer.selectedIndex].value=='1') {
        PRefName.style.display = "table-row";
        PRefName.style.visibility = "visible";
        PRefNRIC.style.display = "table-row";
        PRefNRIC.style.visibility = "visible";
        PRefContact.style.display = "table-row";
        PRefContact.style.visibility = "visible";
        PRefStatus.style.display = "table-row";
        PRefStatus.style.visibility = "visible";
        PRefAmount.style.display = "table-row";
        PRefAmount.style.visibility = "visible";
    }
    else {
        PRefName.style.display = "none";
        PRefName.style.visibility = "hidden";
        PRefNRIC.style.display = "none";
        PRefNRIC.style.visibility = "hidden";
        PRefContact.style.display = "none";
        PRefContact.style.visibility = "hidden";
        PRefStatus.style.display = "none";
        PRefStatus.style.visibility = "hidden";      
        PRefAmount.style.display = "none";
        PRefAmount.style.visibility = "hidden";
    }
    }
    function checkVendorCompanyInfo(){
    var chkVendorCompany = document.getElementById('<%=chkVendorCompany.ClientID %>');
    var VName1 = document.getElementById('<%=VName1.ClientID %>');
    var VName2 = document.getElementById('<%=VName2.ClientID %>');
    var VName3 = document.getElementById('<%=VName3.ClientID %>');
    var VComName = document.getElementById('<%=VComName.ClientID %>');
    var VIC1 = document.getElementById('<%=VIC1.ClientID %>');
    var VIC2 = document.getElementById('<%=VIC2.ClientID %>');
    var VIC3 = document.getElementById('<%=VIC3.ClientID %>');
    var VCompanyNo = document.getElementById('<%=VCompanyNo.ClientID %>');
    var VendorName = document.getElementById('<%=rfvtxtVendorName1.ClientID %>');
    var VendorNRIC = document.getElementById('<%=rfvtxtVendorNric1.ClientID %>');
    var VendorCompanyName = document.getElementById('<%=rfvtxtVendorCompanyName.ClientID %>');
    var VendorCompanyNo = document.getElementById('<%=rfvtxtVendorCompanyNo.ClientID %>');

    if (chkVendorCompany.checked == true) {
        VComName.style.display = "table-row";
        VComName.style.visibility = "visible";
        VCompanyNo.style.display = "table-row";
        VCompanyNo.style.visibility = "visible";
        VName1.style.display = "none";
        VName1.style.visibility = "hidden";
        VName2.style.display = "none";
        VName2.style.visibility = "hidden";
        VName3.style.display = "none";
        VName3.style.visibility = "hidden";
        VIC1.style.display = "none";
        VIC1.style.visibility = "hidden";
        VIC2.style.display = "none";
        VIC2.style.visibility = "hidden"; 
        VIC3.style.display = "none";
        VIC3.style.visibility = "hidden";   
        ValidatorEnable(VendorCompanyName, true);
        ValidatorEnable(VendorCompanyNo, true);
        ValidatorEnable(VendorName, false);
        ValidatorEnable(VendorNRIC, false);       
    }
    else {
        VComName.style.display = "none";
        VComName.style.visibility = "hidden";
        VCompanyNo.style.display = "none";
        VCompanyNo.style.visibility = "hidden";
        VName1.style.display = "table-row";
        VName1.style.visibility = "visible";
        VName2.style.display = "table-row";
        VName2.style.visibility = "visible";
        VName3.style.display = "table-row";
        VName3.style.visibility = "visible";
        VIC1.style.display = "table-row";
        VIC1.style.visibility = "visible";
        VIC2.style.display = "table-row";
        VIC2.style.visibility = "visible";
        VIC3.style.display = "table-row";
        VIC3.style.visibility = "visible";
        ValidatorEnable(VendorName, true);
        ValidatorEnable(VendorNRIC, true);  
        ValidatorEnable(VendorCompanyName, false);
        ValidatorEnable(VendorCompanyNo, false);            
    }
    }
    function checkPurcCompanyInfo(){
    var chkPurcCompany = document.getElementById('<%=chkPurcCompany.ClientID %>');
    var PName1 = document.getElementById('<%=PName1.ClientID %>');
    var PName2 = document.getElementById('<%=PName2.ClientID %>');
    var PName3 = document.getElementById('<%=PName3.ClientID %>');
    var PComName = document.getElementById('<%=PComName.ClientID %>');
    var PIC1 = document.getElementById('<%=PIC1.ClientID %>');
    var PIC2 = document.getElementById('<%=PIC2.ClientID %>');
    var PIC3 = document.getElementById('<%=PIC3.ClientID %>');
    var PCompanyNo = document.getElementById('<%=PCompanyNo.ClientID %>');
    var PurcName = document.getElementById('<%=rfvtxtPurcName1.ClientID %>');
    var PurcNRIC = document.getElementById('<%=rfvtxtPurcNric1.ClientID %>');
    var PurcCompanyName = document.getElementById('<%=rfvtxtPurcCompanyName.ClientID %>');
    var PurcCompanyNo = document.getElementById('<%=rfvtxtPurcCompanyNo.ClientID %>');

    if (chkPurcCompany.checked == true) {
        PComName.style.display = "table-row";
        PComName.style.visibility = "visible";
        PCompanyNo.style.display = "table-row";
        PCompanyNo.style.visibility = "visible";
        PName1.style.display = "none";
        PName1.style.visibility = "hidden";
        PName2.style.display = "none";
        PName2.style.visibility = "hidden";
        PName3.style.display = "none";
        PName3.style.visibility = "hidden";
        PIC1.style.display = "none";
        PIC1.style.visibility = "hidden";
        PIC2.style.display = "none";
        PIC2.style.visibility = "hidden"; 
        PIC3.style.display = "none";
        PIC3.style.visibility = "hidden";
        ValidatorEnable(PurcCompanyName, true);
        ValidatorEnable(PurcCompanyNo, true); 
        ValidatorEnable(PurcName, false);
        ValidatorEnable(PurcNRIC, false);           
    }
    else {
        PComName.style.display = "none";
        PComName.style.visibility = "hidden";
        PCompanyNo.style.display = "none";
        PCompanyNo.style.visibility = "hidden";
        PName1.style.display = "table-row";
        PName1.style.visibility = "visible";
        PName2.style.display = "table-row";
        PName2.style.visibility = "visible";
        PName3.style.display = "table-row";
        PName3.style.visibility = "visible";
        PIC1.style.display = "table-row";
        PIC1.style.visibility = "visible";
        PIC2.style.display = "table-row";
        PIC2.style.visibility = "visible";
        PIC3.style.display = "table-row";
        PIC3.style.visibility = "visible";
        ValidatorEnable(PurcName, true);
        ValidatorEnable(PurcNRIC, true);
        ValidatorEnable(PurcCompanyName, false);
        ValidatorEnable(PurcCompanyNo, false);       
    }
    }
    function Calculation() {
    var ddlVendorReferStatus = document.getElementById('<%=ddlVendorReferStatus.ClientID %>');
    var txtVendorReferAmt = document.getElementById('<%=txtVendorReferAmt.ClientID %>');
    var lblVendorReferralAmt = document.getElementById('<%=lblVendorReferralAmt.ClientID %>');
    var ddlPurcReferStatus = document.getElementById('<%=ddlPurcReferStatus.ClientID %>');
    var txtPurcReferAmt = document.getElementById('<%=txtPurcReferAmt.ClientID %>');
    var lblPurcReferralAmt = document.getElementById('<%=lblPurcReferralAmt.ClientID %>');
    var lblReferral = document.getElementById('<%=lblReferral.ClientID %>');
    var txtVendorAgencyFee = document.getElementById('<%=txtVendorAgencyFee.ClientID %>');
    var txtVendorGsts = document.getElementById('<%=txtVendorGsts.ClientID %>');
    var chkVendorGstPaid = document.getElementById('<%=chkVendorGstPaid.ClientID %>');
    var lblTotalAgencyFee = document.getElementById('<%=lblTotalAgencyFee.ClientID %>');
    var lblForGorv = document.getElementById('<%=lblForGorv.ClientID %>');
    var lblForLister = document.getElementById('<%=lblForLister.ClientID %>');
    var lblGrossAmount = document.getElementById('<%=lblGrossAmount.ClientID %>');
    var lblListingPercent = document.getElementById('<%=lblListingPercent.ClientID %>');
    var txtPurcDisbursement = document.getElementById('<%=txtPurcDisbursement.ClientID %>');
    //Referral Summary    
   if (ddlVendorReferStatus.options[ddlVendorReferStatus.selectedIndex].value=='0' && ddlPurcReferStatus.options[ddlPurcReferStatus.selectedIndex].value=='1'){
        var VendorReferAmt = txtVendorReferAmt.value;
        var PurcReferAmt = txtPurcReferAmt.value;
        var VendorReferralAmt = parseFloat(VendorReferAmt.replace(",","")) + parseFloat(PurcReferAmt.replace(",",""));
        var PurcReferralAmt = parseFloat(0.00);
        lblVendorReferralAmt.value = VendorReferralAmt.toFixed(2);
        lblPurcReferralAmt.value = PurcReferralAmt.toFixed(2);
    }
    else if (ddlVendorReferStatus.options[ddlVendorReferStatus.selectedIndex].value=='1' && ddlPurcReferStatus.options[ddlPurcReferStatus.selectedIndex].value=='0'){
        var VendorReferAmt = txtVendorReferAmt.value;
        var PurcReferAmt = txtPurcReferAmt.value;
        var PurcReferralAmt = parseFloat(VendorReferAmt.replace(",","")) + parseFloat(PurcReferAmt.replace(",",""));
        var VendorReferralAmt = parseFloat(0.00);
        lblVendorReferralAmt.value = VendorReferralAmt.toFixed(2);              
        lblPurcReferralAmt.value = PurcReferralAmt.toFixed(2);
    }
    else if (ddlVendorReferStatus.options[ddlVendorReferStatus.selectedIndex].value=='1' && ddlPurcReferStatus.options[ddlPurcReferStatus.selectedIndex].value=='1') {
        var VendorReferAmt = txtVendorReferAmt.value;
        var PurcReferAmt = txtPurcReferAmt.value;
        var VendorReferralAmt =parseFloat(PurcReferAmt.replace(",",""));
        var PurcReferralAmt = parseFloat(VendorReferAmt.replace(",",""));
        lblVendorReferralAmt.value = VendorReferralAmt.toFixed(2);              
        lblPurcReferralAmt.value = PurcReferralAmt.toFixed(2);
    }
    else {
        var VendorReferAmt = txtVendorReferAmt.value;
        var PurcReferAmt = txtPurcReferAmt.value;
        var VendorReferralAmt = parseFloat(VendorReferAmt.replace(",",""));
        var PurcReferralAmt = parseFloat(PurcReferAmt.replace(",",""));
        lblVendorReferralAmt.value = VendorReferralAmt.toFixed(2);
        lblPurcReferralAmt.value = PurcReferralAmt.toFixed(2);
    }
    //For Gov
    var VendorGsts = txtVendorGsts.value;
    var VendorAgencyFee = txtVendorAgencyFee.value;
    var GST = (parseFloat(VendorGsts.replace(",","")) / 100) * parseFloat(VendorAgencyFee.replace(",",""));    
    lblForGorv.value = GST.toFixed(2);
    //Total Agency Fee
    if (chkVendorGstPaid.checked == '1') {  
        var VendorAgencyFeeVal = txtVendorAgencyFee.value;
        var PurcDisbursement = txtPurcDisbursement.value;    
        var TotalAgencyFee = parseFloat(VendorAgencyFeeVal.replace(",","")) + parseFloat(PurcDisbursement.replace(",",""));
        lblTotalAgencyFee.value = TotalAgencyFee.toFixed(2);        
    }
    else {
        var VendorAgencyFeeVal = txtVendorAgencyFee.value;
        var PurcDisbursement = txtPurcDisbursement.value; 
        var TotalAgencyFee = parseFloat(VendorAgencyFeeVal.replace(",","")) + parseFloat(PurcDisbursement.replace(",","")) - parseFloat(GST);
        lblTotalAgencyFee.value = TotalAgencyFee.toFixed(2);        
    }
    //For Referral
    var Referral = VendorReferralAmt + PurcReferralAmt;
    lblReferral.value = Referral.toFixed(2); 
    //For Lister
    ///var ForLister = ((TotalAgencyFee -Referral) * (parseFloat(lblListingPercent.innerHTML) / 100));
    ///lblForLister.value = ForLister.toFixed(2);
    ///Edited by minginn @ 16/11/2011 - To only take Vendor AgencyFee and Vendor Referrral in calculation of lister fee
    if (chkVendorGstPaid.checked == '1') { 
        var VendorAgencyFeeVal = txtVendorAgencyFee.value;       
        var VendorAgencyFee = parseFloat(VendorAgencyFeeVal.replace(",",""));  
    }
    else {
        var VendorAgencyFeeVal = txtVendorAgencyFee.value;
        var VendorAgencyFee = parseFloat(VendorAgencyFeeVal.replace(",","")) - parseFloat(GST);
    }
    var ListingPercent = lblListingPercent.innerHTML
    var ForLister = ((VendorAgencyFee - VendorReferralAmt) * (parseFloat(ListingPercent.replace(",","")) / 100));
    lblForLister.value = ForLister.toFixed(2);
    //For Gross Amount
    var GrossAmount = TotalAgencyFee - Referral;
    lblGrossAmount.value = GrossAmount.toFixed(2);
    }    
    
    function Validation(field){
    var txtPurcName2 = document.getElementById('<%=txtPurcName2.ClientID %>');
    var rfvPurcNRIC2 = document.getElementById('<%=rfvtxtPurcNric2.ClientID %>');
    var txtPurcName3 = document.getElementById('<%=txtPurcName3.ClientID %>');
    var rfvPurcNRIC3 = document.getElementById('<%=rfvtxtPurcNric3.ClientID %>');
    var txtVendorName2 = document.getElementById('<%=txtVendorName2.ClientID %>');
    var rfvVendorNRIC2 = document.getElementById('<%=rfvtxtVendorNric2.ClientID %>');
    var txtVendorName3 = document.getElementById('<%=txtVendorName3.ClientID %>');
    var rfvVendorNRIC3 = document.getElementById('<%=rfvtxtVendorNric3.ClientID %>');
    if (field=='PName2') {
        if (txtPurcName2.value != '') {
            ValidatorEnable(rfvPurcNRIC2, true);
        }
        else {
            ValidatorEnable(rfvPurcNRIC2, false);
        } 
    }
    else if (field=='PName3') {
        if (txtPurcName3.value != '') {
            ValidatorEnable(rfvPurcNRIC3, true);
        }
        else {
            ValidatorEnable(rfvPurcNRIC3, false);
        } 
    }
    else if (field=='VName2') {
        if (txtVendorName2.value != '') {
            ValidatorEnable(rfvVendorNRIC2, true);
        }
        else {
            ValidatorEnable(rfvVendorNRIC2, false);
        } 
    }
    else if (field=='VName3') {
        if (txtVendorName2.value != '') {
            ValidatorEnable(rfvVendorNRIC2, true);
        }
        else {
            ValidatorEnable(rfvVendorNRIC2, false);
        } 
    }
    }
    </script>

    </div>

</asp:Content>
